home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-07 | 5.4 KB | 111 lines | [TEXT/CWIE] |
- // Copyright (C) 1999 Eric Roccasecca. All rights reserved.
-
- #include <QDOffscreen.h>
-
-
- // Use this to determine if the X-Ray INIT loaded. You should ignore the long gestalt value.
- // Just check the function result for noErr, if noErr then you are good to go. You should
- // also compare the symbol IsXRayLibInstalled to nil to check if X-RayLib is available.
- // See below for more info.
- #define kX_RayGestalt 'XRay'
-
-
- // X-Ray External Errors
- enum {
- kX_RayExtensionNotFoundError = 100,
- kX_RayAppNotInitializedCorrectlyError = 101
- };
-
-
- //--------------------------------------------
- // X-RAY TRANSPARENT WINDOW ROUTINES
- //--------------------------------------------
-
- // DO NOT EVER CALL THIS FUNCTION
- // You can determine if X-RayLib is installed by comparing this fucntion's symbol to nil
- // Example:
- // if (IsXRayLibInstalled == nil) // this gracefully checks for X-RayLib
- // return; // Notice this is NOT a function call, it is a symbol comparison.
- // If you actually call this function and X-RayLib is not available your code will crash.
- void IsXRayLibInstalled (void);
-
- // Initializes X-Ray so an application can use transparent windows
- // Should be called as soon as possible after InitWindows()
- // If result is anything other than noErr, no X-Ray routines may be called
- OSErr InitTransparentWindows (void);
-
- // Makes a new transparent window
- WindowPtr NewTransparentWindow (void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, RgnHandle transRgn, RGBColor *clearColor, OSErr *windowErr);
-
- // Gets a new transparent window from a resource file
- // 'WIND' resource MUST designate the window is not visible
- WindowPtr GetNewTransparentWindow (short windowID, void *wStorage, WindowPtr behind, RgnHandle transRgn, RGBColor *clearColor, OSErr *windowErr);
-
- // Makes a new transparent dialog window
- DialogPtr NewTransparentDialog (void *dStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon, Handle itmLstHndl, RgnHandle transRgn, RGBColor *clearColor, OSErr *windowErr);
-
- // Gets a new transparent dialog window from a resource file
- // 'DLOG' resource MUST designate the window is not visible
- DialogPtr GetNewTransparentDialog (short dialogID, void *dStorage, WindowPtr behind, RgnHandle transRgn, RGBColor *clearColor, OSErr *windowErr);
-
- // Makes a new transparent TSM service window
- OSErr NewTransparentServiceWindow (void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, ComponentInstance ts, WindowPtr *window, RgnHandle transRgn, RGBColor *clearColor);
-
- // Makes an existing TSM service window transparent
- OSErr MakeServiceWindowTransparent (WindowPtr theWindow, Boolean visible, WindowPtr behind, ComponentInstance ts, RgnHandle transRgn, RGBColor *clearColor);
-
- // Behaves like CloseWindow for transparent windows
- void CloseTransparentWindow (WindowPtr theWindow);
-
- // Behaves like DisposeWindow for transparent windows
- void DisposeTransparentWindow (WindowPtr theWindow);
-
- // Behaves like CloseDialog for transparent dialog windows
- void CloseTransparentDialog (DialogPtr theDialog);
-
- // Behaves like DisposeDialog for transparent dialog windows
- void DisposeTransparentDialog (DialogPtr theDialog);
-
- // Behaves like CloseServiceWindow for transparent TSM service windows
- OSErr CloseTransparentServiceWindow (WindowPtr theWindow);
-
- // Returns the content offscreen GWorld of a transparent window
- GWorldPtr GetTransparentWindowContentGWorld (WindowPtr theWindow);
-
- // forces update of a transparent window
- // used mainly after content has been updated after using GetTransparentWindowContentBuffer
- // This should *not* be used in response to update events because this routine will cause another update event to occur
- // and seriaously affect the performance of your software, as well as look really bad.
- // if updateRgn is nil, enire window is updated
- // note, this works by triggering an internal transparent update event
- // and by invalidating the updateRgn passed to the function in theWindow
- // so your own event handler will eventually receive an updateEvent
- void UpdateTransparentWindow (WindowPtr theWIndow, RgnHandle updateRgn);
-
- // Returns true if window is a transparent window
- Boolean IsWindowTransparent (WindowPtr theWindow);
-
- // <<< PARTIALLY IMPLEMENTED >>>
- // Sets the clear color and thus the clear area of a transparent window
- void SetTransparentWindowClearColor (WindowPtr theWindow, RGBColor *newClearColor);
-
- // <<< PARTIALLY IMPLEMENTED >>>
- // Removes the clear color and thus the clear area of a transparent window
- void RemoveTransparentWindowClearColor (WindowPtr theWindow);
-
- // <<< PARTIALLY IMPLEMENTED >>>
- // Limits area of window that is transparent instead of entire content region
- void SetTransparentWindowTransparentRegion (WindowPtr theWindow, RgnHandle transRgn);
-
- // <<< PARTIALLY IMPLEMENTED >>>
- // Restores default transparent area which is entire content region
- void RemoveTransparentWindowTransparentRegion (WindowPtr theWindow);
-
- // <<< PARTIALLY IMPLEMENTED >>>
- // Sets the level of transparency for a window
- void SetWindowTransparency (unsigned short transparency, WindowPtr theWindow);
-
- // Returns the transparency value for a window
- // any return result other than noErr should be considered a failure
- OSErr GetWindowTransparency (unsigned short *transparency, WindowPtr theWindow);
-